package com.study.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author CSDN 流放深圳
 * @description webMVC 配置
 * @create 2024-04-13 15:55
 * @since 1.0.0
 */
@Configuration
@EnableWebMvc
public class LicenceWebConfig implements WebMvcConfigurer {

    @Autowired
    private LicenceInterceptor licenceInterceptor;

    /**
     * 配置拦截器
     *
     * @param registry
     */
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(licenceInterceptor)
                .addPathPatterns("/**");//拦截所有请求
    }
}
